<?php
/**
 * Created by PhpStorm.
 * User: gaochaolyf
 * Date: 16/5/30
 * Time: 下午3:09
 */

namespace home\Model;

use Think\Model;

class GoodsModel extends Model
{

    function __construct() {
        $this->model = M('Goods');
    }

    public function GoodList($field = array('*'), $condition = array(), $page = 1, $pergage = 10, $order = 'goods_id DESC') {
        $data = $this->model->where($condition)->field($field)->page($page, $pergage)->order($order)->select();
        $data = $data ? $data : array();

        return $data;
    }

    public function AddGood($field = array()){
        $data = $this->model->add($field);

        return $data;
    }

}

?>